package main

import (
	"iot-base/auth/common"
	"iot-base/auth/config"
	"iot-base/auth/middleware"
	"iot-base/auth/routes"
	"net/http"

	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	//pprof.Register(r)
	r.Use(middleware.Cors())
	//r.Use(gzip.Gzip(gzip.DefaultCompression))
	//初始化数据
	common.InItData()
	// 初始化 socket.io
	routes.SocketIoRoutes(r)
	// qt api
	routes.QTRouter(r)
	// InitRouter 初始化路由
	routes.InitRouter(r)
	routes.MangeRouter(r)
	r.StaticFS("/h5", http.Dir("./static/h5"))
	r.Run(":" + config.Conf.Server.Port)
}
